// Author: WuJian
#pragma once
#include "../sqlite/see-sqlite3.h"
#include "../stdafx.h"


struct SQLiteKey
{
	int iKeyBytes;
	BYTE data[1];
};

namespace Decrypt
{
	void* GenSQLite3Key(char* szDest, const unsigned short* lpszUser);
	bool SelectOK(sqlite3 *pDB);
}


class CSQLiteKey
{
public:
	explicit CSQLiteKey(const std::wstring &strUser);
	~CSQLiteKey();

	int Size() { return m_pKey->iKeyBytes; }
	void* GetKey() const { return (void*)m_pKey; }

private:

	SQLiteKey* GenKey(const std::wstring &strUser);

private:

	SQLiteKey* m_pKey;
};
